<template>
  <div class="app-container">
    <el-form class="formList" :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="80px">
      <el-row>

        <el-form-item label="客户手机" prop="phone">
          <el-input v-model="queryParams.phone" placeholder="请输入客户手机" clearable style="width: 233px;" size="small" />
        </el-form-item>

        <el-form-item label="确认状态" prop="levelUid">
          <el-select v-model="queryParams.dataStatus" style="width: 233px;" placeholder="请选择" clearable>
            <el-option key="1" label="已确认" value="1"/>
            <el-option key="0" label="待确认" value="0"/>
          </el-select>
        </el-form-item>
        <el-form-item label="创建时间"
          prop="createTimeArr">
          <el-date-picker v-model="queryParams.createTimeArr"
            type="daterange"
            align="right"
            value-format="yyyy-MM-dd"
            unlink-panels
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            style="width: 232px;"
            :picker-options="pickerOptions">
          </el-date-picker>
        </el-form-item>
      </el-row>
      <el-row>

        <el-form-item label="推荐码"
          prop="customerNo">
          <el-input v-model="queryParams.customerNo"
            placeholder="请输入客户推荐码"
            clearable
            size="small"
            style="width: 232px;"
            @keyup.enter.native="handleQuery" />
        </el-form-item>
        <el-form-item label="抵扣类型" prop="deductType">
          <el-select v-model="queryParams.deductType" style="width: 233px" placeholder="请选择">
            <el-option :value="item.dictValue" v-for="(item, idx) in deductTypeList" :key="idx"
              :label="item.dictLabel"></el-option>
          </el-select>
        </el-form-item>

        <el-form-item label="抵扣业务" prop="bizDesc">
          <el-select v-model="queryParams.bizDesc" style="width: 233px" placeholder="请选择">
            <el-option :value="item.dictValue" v-for="(item, idx) in deductBusinessList" :key="idx"
              :label="item.dictLabel"></el-option>
          </el-select>
        </el-form-item>



        <el-form-item style="margin-left: 10px;">
          <el-button type="primary" icon="el-icon-search" size="small" @click="handleQuery">搜索</el-button>
          <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-row>


    </el-form>
    <el-row class="row-mbinfo">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="addDeduct()">新增</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <div class="divTable">
      <el-table border v-loading="loading" :data="fundList" @selection-change="handleSelectionChange">
        <!--      <el-table-column type="selection" width="55" align="center"/>-->
        <!--      <el-table-column label="收益id" align="center" prop="fundUid" />-->
        <!--      <el-table-column label="客户ID" align="center" prop="customerUid" :show-overflow-tooltip="true" />-->
        <el-table-column label="客户名称" min-width="80" align="center" prop="customerName" />
        <el-table-column label="手机号码" min-width="80" align="center" prop="phone" />
        <el-table-column label="客户推荐码" min-width="90" align="center" prop="customerNo" />
        <el-table-column label="抵扣类型" min-width="80" align="center" prop="deductType" />
        <el-table-column label="抵扣业务" min-width="80" align="center" prop="bizDesc" />
        <el-table-column label="抵扣数额" align="center" min-width="80" prop="amount">
        </el-table-column>
        <el-table-column label="确认状态" align="center" min-width="80" prop="deductStatus">
        </el-table-column>
        <el-table-column label="超时小时" align="center" min-width="80" prop="expireHour">
        </el-table-column>
        <el-table-column label="抵扣时间" align="center" min-width="100" prop="createTime" :show-overflow-tooltip="true">
        </el-table-column>
        <el-table-column label="抵扣说明" align="center"  prop="remark" :show-overflow-tooltip="true"/>

        <el-table-column label="操作" align="center" width="100px" class-name="small-padding fixed-width" fixed="right">
          <template slot-scope="scope">

            <el-button size="mini" type="text" icon="el-icon-delete" v-if="scope.row.dataStatus=='0'" @click="delectDeduct(scope.row)">删除
            </el-button>

          </template>
        </el-table-column>

      </el-table>

      <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
        @pagination="getList" />
    </div>


    <!-- 调整资产 -->
    <el-dialog title="资产抵扣" :visible.sync="viewMoney" width="800px">
      <div class="delete-content">
        <div class="product-div">
          <el-form ref="moneyForm" :model="moneyForm" :rules="moneyRule" label-width="90px" size="small">
            <el-row>
              <el-col :span="12">
                <el-form-item label="抵扣类型" prop="deductType">
                  <el-select v-model="moneyForm.deductType" style="width: 250px" placeholder="请选择">
                    <el-option :value="item.dictValue" v-for="(item, idx) in deductTypeList" :key="idx"
                      :label="item.dictLabel"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
             <el-col :span="12">
               <el-form-item label="抵扣数额" prop="amount">
                 <el-input v-model="moneyForm.amount" style="width: 250px" min="0" max="99999" maxlength="5"
                   @input="moneyForm.amount = onInput(moneyForm.amount, 0, null, true)" placeholder="请输入" />
               </el-form-item>
             </el-col>
            </el-row>
            <el-row>
              <el-col :span="12">
                <el-form-item label="抵扣业务" prop="bizDesc">
                  <el-select v-model="moneyForm.bizDesc" style="width: 250px" placeholder="请选择">
                    <el-option :value="item.dictValue" v-for="(item, idx) in deductBusinessList" :key="idx"
                      :label="item.dictLabel"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="客户信息" >
                  <!--
                  <el-input v-model="moneyForm.phone" style="width: 250px"
                    placeholder="请输入" />
                    -->
                    <el-select v-model="moneyForm.phone"
                      ref="agentSelect"
                      filterable
                      remote
                      reserve-keyword
                      style="width: 250px"
                      placeholder="请输入手机号码,用户名称或推荐码"
                      :remote-method="remoteMethod"
                      :loading="selectLoading"
                      @change="changeSelectPhone"
                      @hook:mounted="cancalReadOnly"
                      @visible-change="cancalReadOnly"
                      @keyup.enter.native="handleSearchUser">
                      <el-option v-for="item in phoneList"
                        :key="item.customerUid"
                        :label="`${item.phone} (${item.customerName},${item.customerNo})`"
                        :value="item.customerUid">
                      </el-option>
                    </el-select>
                </el-form-item>

              </el-col>

            </el-row>

            <el-row>
              <el-col :span="12">
                <el-form-item label="超时小时" prop="expireHour">
                  <el-input v-model="moneyForm.expireHour" style="width: 250px" min="0" max="999" maxlength="3"
                    @input="moneyForm.expireHour = onInput(moneyForm.expireHour, 0, null, true)" placeholder="请输入超时小时" />
                </el-form-item>
              </el-col>

            </el-row>


            <el-row>
              <el-col :span="24">
                <el-form-item label="抵扣说明" prop="remark">
                  <el-input v-model="moneyForm.remark" style="width: 610px" placeholder="请输入" />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
      </div>
      <div slot="footer" class="dialog-footer" style="text-align: center">
        <el-button @click="cancelDeleteMoney">关 闭</el-button>
        <el-button type="primary" @click="toDeleteMoney">保 存</el-button>
      </div>
    </el-dialog>





  </div>
</template>

<script>
import {
  listFund,
  getFund,
  delFund,
  addFund,
  updateFund,
  getCustomerProfit,
  getFreeCustomerInfo,
  getFreeSecondCustomerInfo,
  deduct
} from "@/api/customer/fund";
import {
  phoneGetUser,
} from "@/api/service/makePlan";
import { onInput } from "@/utils/util";
export default {
  name: "Fund",
  components: {},
  data () {
    let validatePass1 = (rule, value, callback) => {
      if (value) {
        if (!(value >= -100000 && value <= 100000)) {
          callback(new Error('请输入-100000-100000之间的数字'));
        } else {
          callback();
        }
      } else {
        callback();
      }
    }

    let validatePass2 = (rule, value, callback) => {
      if (value) {
        if (!(value >= -100000 && value <= 100000)) {
          callback(new Error('请输入-100000-100000之间的数字'));
        } else {
          callback();
        }
      } else {
        callback();
      }
    }

    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      //查询总条数
      queryTotal: 0,
      //积分弹出框
      scoreTitle: "",
      scoreviewOpen: false,
      scoreLoading: true,
      scoreDetailList: [],
      //粉丝弹出框
      freeOpen: false,
      freeLoading: true,
      //粉丝客户信息数组
      freeCustomerInfo: [],
      // 客户收益表格数据
      fundList: [],
      //客户收益详细
      fundDetailList: [],
      //分页存储客户id
      customerIdInfo: "",
      phoneList: [],
      // 弹出层标题
      title: "",
      //查看详细标题
      viewTitle: "",
      // 是否显示弹出层
      open: false,
      //是否显示查看详细弹出层
      viewOpen: false,
      //查看详细数据
      showData: [],
      // 性别 1男，0女字典
      sexOptions: [],
      //总收益列表标题
      profitTitle: "",
      //总收益列表弹出
      profitviewOpen: false,
      //等级信息
      LevelInfoArr: [],
      // 扣除咨询
      viewMoney: false,
      storeFeeDetail: [],
      storeSize: 10,
      storeNum: 1,
      storeTotal: 0,
      moneyCustomerUid: '',
      moneyForm: {
        score: 0,
      },
      moneyRule: {
        deductType: [{
          required: true,
          message: "请选择抵扣类型",
          trigger: "change"
        }],
        bizDesc: [{
          required: true,
          message: "请选择抵扣业务",
          trigger: "change"
        }],
        phone: [
          {
            required: true,
            message: "请输入手机号码",
            trigger: "blur",
          }
        ],
        amount: [
          {
            required: true,
            message: "请输入抵扣数额",
            trigger: "blur"
          }
        ],
        expireHour: [
          {
            required: true,
            message: "请输入超时小时",
            trigger: "blur"
          }
        ],
        remark: [{
          required: true,
          message: "请输入抵扣说明",
          trigger: "blur"
        }],
      },
      storeList: [],
      userQuery:null,
      selectLoading: false,
      //抵扣类型列表
      deductTypeList:[],
      //抵扣业务列表
      deductBusinessList:[],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        customerUid: null,
        allProfit: null,
        allWithdraw: null,
        allScore: null,
        allFreeze: null,
        allBalance: null,
        allFans: null,
        allFansSecond: null,
        updateTime: null,
        customerName: null,
        levelUid: "",
        minallProfit: "",
        maxallProfit: "",
        minFreezeProfit: "",
        maxFreezeProfit: "",
        minAllScore: "",
        maxAllScore: "",
        minScore: "",
        maxScore: "",
        minFreezeScore: "",
        maxFreezeScore: "",
        minallBalance: "",
        maxAllBalance: "",
        minAllRedBag: "",
        maxAllRedBag: "",
        minAllFans: "",
        maxAllFans: "",
        minAllFansSecond: "",
        maxAllFansSecond: "",
        createTimeArr: []
      },
      // 条件查询参数
      queryFundDetailParams: {
        pageNum: 1,
        pageSize: 10,
        groupName: null,
      },
      //查看收益详细参数
      DetailqueryParams: {
        pageNum: 1,
        pageSize: 10,
        customerUid: null,
        bizDesc: null,
        bizType: null,
        bizNo: null,
        itemUid: null,
        amount: null,
        remark: null,
        bizTime: null,
        createTime: null,
        dataStatus: null,
        updateTime: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        customerUid: [{
          required: true,
          message: "会员ID不能为空",
          trigger: "blur"
        }],
      },
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick (picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
    };
  },
  created () {
    this.getDicts("customer_sex").then(response => {
      this.sexOptions = response.data;
    });
    this.getList();
    this.getDicts("sys_deduct_type").then(response => {
      this.deductTypeList = response.data;
    });
    this.getDicts("sys_deduct_business").then(response => {
      this.deductBusinessList = response.data;
    });
  },
  methods: {
    onInput,
    remoteMethod (query) {
      //console.log("===remoteMethod===")
      if (query !== '') {
        this.userQuery = query
        this.handleSearchUser()
      } else {
        // this.options = [];
      }
    },
    async changeSelectPhone (uid) {
      this.phoneList.forEach(item => {
        if (item.customerUid == uid) {
          this.moneyForm.phone = item.customerUid
          /*
          this.refForm.customerId = item.customerUid
          this.refForm.cusotmerName = item.customerName
          this.refForm.phone = item.phone
          this.refForm.sendNumber = 1
          */
        }
      })
    },
    cancalReadOnly (onOff) {
      this.$nextTick(() => {
        if (!onOff) {
          const Selects = this.$refs
          if (Selects.agentSelect) {
            const input = Selects.agentSelect.$el.querySelector('.el-input__inner')
            input.removeAttribute('readonly')
          }
        }
      })
    },
    handleSearchUser () {
      this.selectLoading = true;
      setTimeout(() => {
        phoneGetUser({ name: this.userQuery })
          .then(res => {
            this.selectLoading = false;
            this.phoneList = res.data
          })
          .catch(() => { })
      }, 200);
    },

    async getViewStoreList () {
      let res = await selectGroup()
      if (res) {
        let { data } = res
        this.storeList = data
      }
    },
    listFundStorePage () {
      let data = {
        pageSize: this.storeSize,
        pageNum: this.storeNum,
        businessType: 'storeBalance'
      }
      myBalanceDetail(this.moneyCustomerUid, data).then((response) => {
        this.storeFeeDetail = response.storeBalance.rows;
        this.storeTotal = response.storeBalance.total;
        this.viewMoney = true
      });
    },
    addDeduct () {
      //this.moneyCustomerUid = row.customerUid
      //this.listFundStorePage()
      this.viewMoney = true
      this.phoneList = [];
    },
    delectDeduct(row){
      this.$confirm('是否确认删除该数据项?', "警告", {
                confirmButtonText: "确定",
                cancelButtonText: "取消",
                type: "warning"
              }).then(function() {
                return delFund(row.detailUid);
              }).then(() => {
                this.getList();
                this.msgSuccess("删除成功");
              }).catch(() => {});

    },
    cancelDeleteMoney () {
      this.viewMoney = false
      this.moneyForm = {
        gold: 0,
        silver: 0,
        profit: 0,
        score: 0,
        remark: '',
        storeId: ''
      }
      this.moneyCustomerUid = ''
      this.$refs['moneyForm'].resetFields();
    },
    toDeleteMoney () {
       deduct({
         ...this.moneyForm
       }).then(res => {
         this.msgSuccess('操作成功')
         this.getList();
         this.cancelDeleteMoney()
       });
    },
    /** 查询客户收益列表 */
    getList () {
      this.loading = true;
      listFund(this.queryParams).then(response => {
        this.fundList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 性别 1男，0女字典翻译
    sexFormat (row, column) {
      return this.selectDictLabel(this.sexOptions, row.sex);
    },
    // 取消按钮
    cancel () {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset () {
      this.form = {
        fundUid: null,
        customerUid: null,
        allProfit: null,
        allWithdraw: null,
        allScore: null,
        allFreeze: null,
        allBalance: null,
        allFans: null,
        allFansSecond: null,
        updateTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery () {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    oninput (num, limit) {

      if (num == "") {
        return "";
      }
      var str = num
      var len1 = str.substr(0, 1)
      var len2 = str.substr(1, 1)
      if (str.length > 1 && len1 == 0 && len2 != ".") {
        str = str.substr(1, 1)
      }
      if (len1 == ".") {
        str = ""
      }
      if (str.indexOf(".") != -1) {
        var str_ = str.substr(str.indexOf(".") + 1)
        if (str_.indexOf(".") != -1) {
          str = str.substr(0, str.indexOf(".") + str_.indexOf(".") + 1)
        }
      }
      //正则替换
      str = str.replace(/[^\d^\.]+/g, '') // 保留数字和小数点
      if (limit / 1 === 1) {
        str = str.replace(/^\D*([0-9]\d*\.?\d{0,1})?.*$/, '$1') // 小数点后只能输 1 位
      } else {
        str = str.replace(/^\D*([0-9]\d*\.?\d{0,2})?.*$/, '$1') // 小数点后只能输 2 位

        if (str.indexOf(".") == str.length - 1) {
          str = str.substring(0, str.length - 1);
        }
      }

      return str
    },
    checkNumberOne (value) {
      return value.replace(/^(0+)|[^\d]+/g, '')
    },
    checkNumber (minNum, maxNum, index) {

      if (index == 1) {
        if (minNum == "") {
          return "";
        }
        if (maxNum == "") {
          return minNum;
        }
        let min = parseFloat(minNum);
        let max = parseFloat(maxNum);
        if (min > max) {
          return maxNum;
        } else {
          return minNum;
        }
      } else {

        if (maxNum == "") {
          return "";
        }
        if (minNum == "") {
          return maxNum;
        }
        let min = parseFloat(minNum);
        let max = parseFloat(maxNum);
        if (min > max) {
          return minNum;
        } else {
          return maxNum;
        }
      }
    },
    /** 重置按钮操作 */
    resetQuery () {
      this.resetForm("queryForm");
      this.queryParams.minallProfit = "";
      this.queryParams.maxallProfit = "";

      this.queryParams.minFreezeProfit = "";
      this.queryParams.maxFreezeProfit = "";

      this.queryParams.minAllScore = "";
      this.queryParams.maxAllScore = "";

      this.queryParams.minScore = "";
      this.queryParams.maxScore = "";

      this.queryParams.minFreezeScore = "";
      this.queryParams.maxFreezeScore = "";

      this.queryParams.minallBalance = "";
      this.queryParams.maxAllBalance = "";

      this.queryParams.minAllRedBag = "";
      this.queryParams.maxAllRedBag = "";

      this.queryParams.minAllFans = "";
      this.queryParams.maxAllFans = "";

      this.queryParams.minAllFansSecond = "";
      this.queryParams.maxAllFansSecond = "";
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange (selection) {
      this.ids = selection.map(item => item.fundUid)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd () {
      this.reset();
      this.open = true;
      this.title = "添加客户收益";
    },
    /** 查看详情按钮操作 **/
    handleShowDetail (row) {
      this.viewOpen = true;
      this.viewTitle = "查看客户收益";
      this.showData = [];
      this.columns.forEach(item => {
        this.showData.push({
          label: item.label,
          value: row[item.dataIndex]
        })
      })
    },
    handCloseDetail () {
      this.viewOpen = false
      this.showData = []
    },
    /** 修改按钮操作 */
    handleUpdate (row) {
      this.reset();
      const fundUid = row.fundUid || this.ids
      getFund(fundUid).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改客户收益";
      });
    },
    /** 提交按钮 */
    submitForm () {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.fundUid != null) {
            updateFund(this.form).then(response => {
              this.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addFund(this.form).then(response => {
              this.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete (row) {
      const fundUids = row.fundUid || this.ids;
      this.$confirm('是否确认删除客户收益编号为"' + fundUids + '"的数据项?', "警告", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      }).then(function () {
        return delFund(fundUids);
      }).then(() => {
        this.getList();
        this.msgSuccess("删除成功");
      })
    },
    /** 导出按钮操作 */
    handleExport () {
      this.download('customer/fund/export', {
        ...this.queryParams
      }, `客户资金.xlsx`)
    },
    //查看总收益
    handleProfitdetail (customerUid, bizType) {
      this.DetailqueryParams.pageNum = 1;
      this.DetailqueryParams.pageSize = 10;
      this.fundDetailList = [];
      this.customerIdInfo = [];
      this.customerIdInfo = customerUid;
      let title = "";
      if (bizType == 'profit') {
        title = "总收益列表";
      } else if (bizType == 'balance') {
        title = "金币详细列表";
      } else if (bizType == 'redBag') {
        title = "银币详细列表";
      }
      this.profitTitle = title;
      this.profitviewOpen = true;
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = 1;
      this.DetailqueryParams.bizType = bizType;
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.fundDetailList = response.rows;
        this.queryTotal = response.total;
      });
    },
    //查看总积分
    handleScoredetail (customerUid, bizType, status) {
      this.DetailqueryParams.pageNum = 1;
      this.DetailqueryParams.pageSize = 10;
      console.log(customerUid)
      console.log(bizType)
      console.log(status)
      this.scoreDetailList = [];
      this.customerIdInfo = [];
      this.customerIdInfo = customerUid;
      let title = "";
      if (status == 1) {
        title = "菠萝派详细列表";
      }
      if (status == 2) {
        title = "冻结积分详细列表";
      }
      this.scoreTitle = title;
      this.scoreviewOpen = true;
      this.scoreLoading = true;
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = status;
      this.DetailqueryParams.bizType = bizType;
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.scoreLoading = false;
        this.scoreDetailList = response.rows;
        this.queryTotal = response.total;
      });
    },

    //总收益分页
    showCustomerInfo (bizType) {
      console.log(bizType);
      let customerUid = this.customerIdInfo
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = 1;
      this.DetailqueryParams.bizType = bizType;
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.fundDetailList = response.rows;
      });
    },
    //总积分分页
    showScoreCustomerInfo (bizType) {
      console.log(bizType);
      let customerUid = this.customerIdInfo
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = 1;
      this.DetailqueryParams.bizType = bizType;
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.scoreDetailList = response.rows;
      });
    },

    //查看总积分详细
    handleScoreDetail (row) {
      this.fundDetailList = [];
      let customerUid = row.customerUid;
      this.profitTitle = "菠萝派详细列表"
      this.profitviewOpen = true;
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = 1;
      this.DetailqueryParams.bizType = "score";
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.fundDetailList = response.rows;
        this.queryTotal = response.total;
      });
    },

    //查看余额详细
    handleBalanceDetail (row) {
      this.fundDetailList = [];
      let customerUid = row.customerUid;
      this.profitTitle = "金币详细列表"
      this.profitviewOpen = true;
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = 1;
      this.DetailqueryParams.bizType = "balance";
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.fundDetailList = response.rows;
        this.queryTotal = response.total;
      });
    },

    //查看红包详细
    handleRedBagDetail (row) {
      this.fundDetailList = [];
      let customerUid = row.customerUid;
      this.profitTitle = "银币详细列表"
      this.profitviewOpen = true;
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = 1;
      this.DetailqueryParams.bizType = "redBag";
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.fundDetailList = response.rows;
        this.queryTotal = response.total;
      });
    },

    //查看一级粉丝详细
    handleAllFansDetail (row) {
      this.freeCustomerInfo = [];
      getFreeCustomerInfo(row.customerUid).then(response => {
        this.freeOpen = true;
        this.freeLoading = false;
        this.freeCustomerInfo = response.rows;
      });
    },
    //查看间接粉丝详细
    handleAllFansSecondDetail (row) {
      this.freeCustomerInfo = [];
      getFreeSecondCustomerInfo(row.customerUid).then(response => {
        this.freeOpen = true;
        this.freeLoading = false;
        this.freeCustomerInfo = response.rows;
      });
    },
    handCloseFreeInfoDetail () {
      this.freeOpen = false;
    },
    handleProfitFreeze (row) {
      this.fundDetailList = [];
      let customerUid = row.customerUid;
      this.profitTitle = "冻结资金列表"
      this.profitviewOpen = true;
      this.DetailqueryParams.customerUid = customerUid;
      this.DetailqueryParams.dataStatus = 2;
      getCustomerProfit(this.DetailqueryParams).then(response => {
        console.log(response)
        this.fundDetailList = response.rows;
      });
    },
    //查看总收益取消按钮
    handCloseProfitDetail () {
      this.profitviewOpen = false
    },
  }
};
</script>

<style scoped>
.product-div {
  background-color: #fff;
  position: relative;
  padding-right: 16px;
  padding-left: 16px;
  padding-top: 54px;
  border: 1px solid #ebebeb;
  -moz-border-radius: 10px;
  border-radius: 10px;
  width: 100%;
  margin: auto;
  margin-bottom: 30px;
  padding-bottom: 10px;
}

.product-header {
  position: absolute;
  top: 0;
  width: 600px;
  padding: 18px;
  padding-left: 0;
  background-color: #fff;
  -moz-border-radius: 4px;
  border-radius: 4px;
  height: 40px;
}
</style>
